//
//  TTMyAddressViewCell.m
//  TaoTuo
//
//  Created by 周晨晔 on 2019/9/23.
//  Copyright © 2019 admin. All rights reserved.
//

#import "TTMyAddressViewCell.h"

@interface TTMyAddressViewCell ()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UIButton *chooseBtn;

@property (nonatomic, strong) TTAddressModel *model;

@property (nonatomic, assign) BOOL isChangeAddress;

@end

@implementation TTMyAddressViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.backgroundColor = [UIColor whiteColor];
}

- (IBAction)chooseBtnClick:(UIButton *)sender {
    
    sender.selected = !sender.selected;
    
    if (self.selectBlock) {
        self.selectBlock(self, self.model);
    }
}

- (void)setModel:(TTAddressModel *)model isChangeAddress:(BOOL)isChangeAddress
{
    _model = model;
    _isChangeAddress = isChangeAddress;
    
    self.chooseBtn.enabled = isChangeAddress;
    
    self.titleLabel.text = [NSString stringWithFormat:@"收货人：%@    %@", model.ReceiverName, model.ReceiverMobile];
    self.contentLabel.text = [NSString stringWithFormat:@"%@%@%@%@", model.Province, model.City, model.Area, model.Address];
    
    self.chooseBtn.selected = model.isSelect;
    
    
}


@end
